package com.lg.product.controller;


import com.lg.product.entity.Category;
import com.lg.product.entity.SpecParam;
import com.lg.product.service.ISpecParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 规格参数组下的参数名 前端控制器
 * </p>
 *
 * @author song
 * @since 2020-07-22
 */
@RestController
@RequestMapping("/spec-param")
public class SpecParamController {

    @Autowired
    private ISpecParamService iSpecParamService;

    /**
     * 规格 参数 添加
     * @param specParam
     * @return
     */
    @RequestMapping("addSpecParam")
    public int addSpecParam(@RequestBody SpecParam specParam){
        System.out.println("==========="+specParam);
        iSpecParamService.addSpecParam(specParam);
        return 1;
    }

    /**
     * 规格 参数 删除
     * @param id
     * @return
     */
    @RequestMapping("deleteIdParam")
    public int deleteIdParam(Integer id){
        int i = iSpecParamService.deleteIdParam(id);
        return i;
    }

}
